home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
026-050
/
scopedisk33
/
fortune
/
fortune.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-18
|
616b
|
27 lines
/* fortune.rexx -- print out a fortune from the fortune file */
/* change the filename here to reflect where the 'fortune.data file is' */
datafile = 'db:fortune.data'
dummy = addlib('rexxsupport.library',0,-30,0)
dummy = time('S')
call randu(dummy)
say
if open(infile,datafile,'R') = 1 then do
fortsize = word(statef(datafile),2)
pick = randu()*140278
pick = delstr(pick,pos('.',pick))
dummy = seek(infile,pick,'B')
instring = readln(infile)
do until left(instring,1,1) = '~'
instring = readln(infile)
end
do i = 1 to word(instring,2)
say readln(infile)
end
end
say
call close(infile)